using System;
using Castle.ActiveRecord;
using WineCellar.Data;

namespace WineCellar.Data
{
	[ActiveRecord("aspnet_Users", Schema = "dbo", Lazy = true, UseAutoImport = false)]
    public partial class User
    {
        private Nullable<Guid> applicationId;

        private string userName;

        private string loweredUserName;

        private string mobileAlias;

        private Nullable<bool> isAnonymous;

        private Nullable<DateTime> lastActivityDate;

        private Nullable<Guid> userId;      

        [Property("ApplicationId",ColumnType = "Guid",NotNull = true)]
        public virtual Nullable<Guid> ApplicationId
        {
            get
            {
                return this.applicationId;
            }
            set
            {
                this.applicationId = value;
            }
        }

        [Property("UserName", ColumnType = "String", NotNull = true)]
        public virtual string UserName
        {
            get
            {
                return this.userName;
            }
            set
            {
                this.userName = value;
            }
        }

        [Property("LoweredUserName", ColumnType = "String", NotNull = true)]
        public virtual string LoweredUserName
        {
            get
            {
                return this.loweredUserName;
            }
            set
            {
                this.loweredUserName = value;
            }
        }

        [Property("MobileAlias", ColumnType = "String")]
        public virtual string MobileAlias
        {
            get
            {
                return this.mobileAlias;
            }
            set
            {
                this.mobileAlias = value;
            }
        }

        [Property("IsAnonymous", ColumnType = "Boolean", NotNull = true)]
        public virtual Nullable<bool> IsAnonymous
        {
            get
            {
                return this.isAnonymous;
            }
            set
            {
                this.isAnonymous = value;
            }
        }

        [Property("LastActivityDate", ColumnType = "Timestamp", NotNull = true)]
        public virtual Nullable<DateTime> LastActivityDate
        {
            get
            {
                return this.lastActivityDate;
            }
            set
            {
                this.lastActivityDate = value;
            }
        }

        [PrimaryKey(PrimaryKeyType.Guid, "UserId")]
        public virtual Nullable<Guid> UserId
        {
            get
            {
                return this.userId;
            }
            set
            {
                this.userId = value;
            }
        }

        public override string ToString()
        {
            return this.UserName;
        }
    }  
}
